import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: () => import(/* webpackChunkName: "home" */ "../pages/home"),
    children: [
      {
        path: "/mine",
        component: () =>
          import(/* webpackChunkName: "mine" */ "../pages/home/mine"),
        //路由元信息
        meata: {
          //储存一些用户定义的属性
        },
      },
    ],
  },
  {
    path: "/login",
    name: "login",
    component: () => import(/* webpackChunkName: "login" */ "../pages/login"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
